<?php

use App\Admin\Controllers\ActivityZoneController;
use App\Admin\Controllers\AreaController;
use App\Admin\Controllers\AddressController;
use App\Admin\Controllers\AjaxController;
use App\Admin\Controllers\AmountController;
use App\Admin\Controllers\AuctionBidController;
use App\Admin\Controllers\AuctionController;
use App\Admin\Controllers\AuctionOrderController;
use App\Admin\Controllers\Audit\AuditAfterSaleController;
use App\Admin\Controllers\Audit\AuditAuctionCertificationController;
use App\Admin\Controllers\Audit\AuditAuctionController;
use App\Admin\Controllers\Audit\AuditBankController;
use App\Admin\Controllers\Audit\AuditRealNameAuthController;
use App\Admin\Controllers\Audit\AuditInviteCertificationController;
use App\Admin\Controllers\Audit\AuditWithdrawController;
use App\Admin\Controllers\Audit\AuditFeedbackController;
use App\Admin\Controllers\BuyWillController;
use App\Admin\Controllers\CategoryController;
use App\Admin\Controllers\CouponController;
use App\Admin\Controllers\HomeController;
use App\Admin\Controllers\ImController;
use App\Admin\Controllers\ImportPlugController;
use App\Admin\Controllers\ImportProductController;
use App\Admin\Controllers\IndexModuleController;
use App\Admin\Controllers\KefuController;
use App\Admin\Controllers\MessageController;
use App\Admin\Controllers\NotifyController;
use App\Admin\Controllers\OperateLogController;
use App\Admin\Controllers\PaymentController;
use App\Admin\Controllers\PaymentRelatedController;
use App\Admin\Controllers\PlugController;
use App\Admin\Controllers\RefundController;
use App\Admin\Controllers\ReturnAddressController;
use App\Admin\Controllers\RoleController;
use App\Admin\Controllers\SalesRecordController;
use App\Admin\Controllers\ShopOrderController;
use App\Admin\Controllers\ShopOrderReturnController;
use App\Admin\Controllers\ShopProductAnimalController;
use App\Admin\Controllers\ShopProductController;
use App\Admin\Controllers\ShopProductFeedController;
use App\Admin\Controllers\ShopProductHelpController;
use App\Admin\Controllers\ShopProductSpecController;
use App\Admin\Controllers\ShopUserController;
use App\Admin\Controllers\SlideController;
use App\Admin\Controllers\SourceMaterialController;
use App\Admin\Controllers\StaffController;
use App\Admin\Controllers\SystemConfigController;
use App\Admin\Controllers\UploadController;
use App\Admin\Controllers\UploadFileController;
use App\Admin\Controllers\UserAdjustmentController;
use App\Admin\Controllers\WithdrawController;
use Encore\Admin\Facades\Admin;
use Illuminate\Support\Facades\Route;
Admin::routes();
Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
    'as' => config('admin.route.prefix') . '.',
], function () {
    Route::get(null, [HomeController::class, 'index'])->name('home.index');
    Route::prefix('ajax')->group(function () {
        Route::get('category', [AjaxController::class, 'category'])->name('ajax.category');
        Route::get('cate/{id}', [AjaxController::class, 'cate'])->name('ajax.cate')->whereNumber('id');
        Route::post('getSpecByProductId', [AjaxController::class, 'getSpecByProductId'])->name('ajax.getSpecByProductId');
        Route::post('webman', [AjaxController::class, 'webman'])->name('ajax.webman');
        Route::post('addImgOne', [AjaxController::class, 'addImgOne'])->name('ajax.addImgOne');
        Route::post('addStaff', [AjaxController::class, 'addStaff'])->name('ajax.addStaff');
        Route::post('deliver', [AjaxController::class, 'deliver'])->name('ajax.deliver');
        Route::any('action', [AjaxController::class, 'action'])->name('ajax.action');
        Route::any('batch', [AjaxController::class, 'batch'])->name('ajax.batch');
        Route::post('addCategory', [AjaxController::class, 'addCategory'])->name('ajax.addCategory');
        Route::post('productSpecsList', [AjaxController::class, 'productSpecsList'])->name('ajax.productSpecsList');
    });
    Route::prefix('withdraw')->group(function () {
        Route::get(null, [WithdrawController::class, 'index'])->name('withdraw.index');
        Route::get('{id}', [WithdrawController::class, 'detail'])->name('withdraw.detail')->whereNumber('id');
    });
    Route::prefix('activityZone')->group(function () {
        Route::get(null, [ActivityZoneController::class, 'index'])->name('activityZone.index');
        Route::get('create', [ActivityZoneController::class, 'create'])->name('activityZone.create');
        Route::get('{id}/edit', [ActivityZoneController::class, 'edit'])->name('activityZone.edit');
        Route::post('save', [ActivityZoneController::class, 'save'])->name('activityZone.save');
    });
    Route::prefix('shopOrder')->group(function () {
        Route::get(null, [ShopOrderController::class, 'index'])->name('shopOrder.index');
        Route::get('{id}', [ShopOrderController::class, 'detail'])->name('shopOrder.detail')->whereNumber('id');
        Route::get('paging', [ShopOrderController::class, 'paging'])->name('shopOrder.paging');
    });
    Route::prefix('shopProduct')->group(function () {
        Route::get(null, [ShopProductController::class, 'index'])->name('shopProduct.index');
        Route::get('{id}', [ShopProductController::class, 'detail'])->name('shopProduct.detail')->whereNumber('id');
        Route::get('paging', [ShopProductController::class, 'paging'])->name('shopProduct.paging');
    });
    Route::prefix('shopProductAnimal')->group(function () {
        Route::get(null, [ShopProductAnimalController::class, 'index'])->name('shopProductAnimal.index');
        Route::get('create', [ShopProductAnimalController::class, 'create'])->name('shopProductAnimal.create');
        Route::get('{id}/edit', [ShopProductAnimalController::class, 'edit'])->name('shopProductAnimal.edit')->whereNumber('id');
        Route::post(null, [ShopProductAnimalController::class, 'store'])->name('shopProductAnimal.store');
        Route::put('{id}', [ShopProductAnimalController::class, 'update'])->name('shopProductAnimal.update')->whereNumber('id');
        Route::get('{id}', [ShopProductAnimalController::class, 'detail'])->name('shopProductAnimal.detail')->whereNumber('id');
    });
    Route::prefix('shopProductFeed')->group(function () {
        Route::get(null, [ShopProductFeedController::class, 'index'])->name('shopProductFeed.index');
        Route::get('create', [ShopProductFeedController::class, 'create'])->name('shopProductFeed.create');
        Route::get('{id}/edit', [ShopProductFeedController::class, 'edit'])->name('shopProductFeed.edit')->whereNumber('id');
        Route::post(null, [ShopProductFeedController::class, 'store'])->name('shopProductFeed.store');
        Route::put('{id}', [ShopProductFeedController::class, 'update'])->name('shopProductFeed.update')->whereNumber('id');
        Route::get('{id}', [ShopProductFeedController::class, 'detail'])->name('shopProductFeed.detail')->whereNumber('id');
    });
    Route::prefix('category')->group(function () {
        Route::get(null, [CategoryController::class, 'index'])->name('category.index');
    });
    Route::prefix('importProduct')->group(function () {
        Route::get(null, [ImportProductController::class, 'index'])->name('importProduct.index');
        Route::get('create', [ImportProductController::class, 'create'])->name('importProduct.create');
        Route::post(null, [ImportProductController::class, 'store'])->name('importProduct.store');
    });
    Route::prefix('upload')->group(function () {
        Route::post(null, [UploadController::class, 'upload'])->name('upload');
        Route::post('multiple', [UploadController::class, 'multiple'])->name('upload.multiple');
    });
    Route::prefix('returnAddress')->group(function () {
        Route::get(null, [ReturnAddressController::class, 'index'])->name('returnAddress.index');
        Route::get('create', [ReturnAddressController::class, 'create'])->name('returnAddress.create');
        Route::get('{id}/edit', [ReturnAddressController::class, 'edit'])->name('returnAddress.edit')->whereNumber('id');
        Route::post(null, [ReturnAddressController::class, 'store'])->name('returnAddress.store');
        Route::put('{id}', [ReturnAddressController::class, 'update'])->name('returnAddress.update')->whereNumber('id');
    });
    Route::prefix('shopOrderReturn')->group(function () {
        Route::get(null, [ShopOrderReturnController::class, 'index'])->name('shopOrderReturn.index');
        Route::get('{id}', [ShopOrderReturnController::class, 'detail'])->name('shopOrderReturn.detail')->whereNumber('id');
        Route::get('paging', [ShopOrderReturnController::class, 'paging'])->name('shopOrderReturn.paging');
    });
    Route::prefix('im')->group(function () {
        Route::get(null, [ImController::class, 'index'])->name('im.index');
    });
    Route::prefix('message')->group(function () {
        Route::get(null, [MessageController::class, 'index'])->name('message.index');
    });
    Route::prefix('systemConfig')->group(function () {
        Route::get(null, [SystemConfigController::class, 'index'])->name('systemConfig.index');
        Route::get('{id}/edit', [SystemConfigController::class, 'edit'])->name('systemConfig.edit')->whereNumber('id');
        Route::put('{id}', [SystemConfigController::class, 'update'])->name('systemConfig.update')->whereNumber('id');
    });
    Route::prefix('paymentRelated')->group(function () {
        Route::get(null, [PaymentRelatedController::class, 'index'])->name('paymentRelated.index');
        Route::get('{id}', [PaymentRelatedController::class, 'detail'])->name('paymentRelated.detail')->whereNumber('id');
    });
    Route::prefix('notify')->group(function () {
        Route::get(null, [NotifyController::class, 'index'])->name('notify.index');
        Route::get('{id}', [NotifyController::class, 'detail'])->name('notify.detail')->whereNumber('id');
    });
    Route::prefix('refund')->group(function () {
        Route::get(null, [RefundController::class, 'index'])->name('refund.index');
        Route::get('{id}', [RefundController::class, 'detail'])->name('refund.detail')->whereNumber('id');
    });
    Route::prefix('payment')->group(function () {
        Route::get(null, [PaymentController::class, 'index'])->name('payment.index');
        Route::get('{id}', [PaymentController::class, 'detail'])->name('payment.detail')->whereNumber('id');
    });
    Route::prefix('slide')->group(function () {
        Route::get(null, [SlideController::class, 'index'])->name('slide.index');
        Route::get('create', [SlideController::class, 'create'])->name('slide.create');
        Route::get('{id}/edit', [SlideController::class, 'edit'])->name('slide.edit')->whereNumber('id');
        Route::post(null, [SlideController::class, 'store'])->name('slide.store');
        Route::put('{id}', [SlideController::class, 'update'])->name('slide.update')->whereNumber('id');
    });
    Route::prefix('uploadFile')->group(function () {
        Route::get(null, [UploadFileController::class, 'index'])->name('uploadFile.index');
        Route::get('create', [UploadFileController::class, 'create'])->name('uploadFile.create');
        Route::post('save', [UploadFileController::class, 'save'])->name('uploadFile.save');
        Route::get('{id}', [UploadFileController::class, 'detail'])->name('uploadFile.detail')->whereNumber('id');
    });
    Route::prefix('staff')->group(function () {
        Route::get(null, [StaffController::class, 'index'])->name('staff.index');
    });
    Route::prefix('amount')->group(function () {
        Route::get(null, [AmountController::class, 'index'])->name('amount.index');
        Route::get('{id}', [AmountController::class, 'detail'])->name('amount.detail')->whereNumber('id');
    });
    Route::prefix('userAdjustment')->group(function () {
        Route::get(null, [UserAdjustmentController::class, 'index'])->name('user_adjustment.index');
        Route::get('{id}', [UserAdjustmentController::class, 'detail'])->name('user_adjustment.detail')->whereNumber('id');
    });
    Route::prefix('shopUser')->group(function () {
        Route::get(null, [ShopUserController::class, 'index'])->name('shopUser.index');
        Route::get('{id}', [ShopUserController::class, 'detail'])->name('shopUser.detail')->whereNumber('id');
    });
    Route::prefix('indexModule')->group(function () {
        Route::get(null, [IndexModuleController::class, 'index'])->name('indexModule.index');
        Route::get('create', [IndexModuleController::class, 'create'])->name('indexModule.create');
        Route::get('{id}/edit', [IndexModuleController::class, 'edit'])->name('indexModule.edit')->whereNumber('id');
        Route::post(null, [IndexModuleController::class, 'store'])->name('indexModule.store');
        Route::put('{id}', [IndexModuleController::class, 'update'])->name('indexModule.update')->whereNumber('id');
    });
    Route::prefix('salesRecord')->group(function () {
        Route::get(null, [SalesRecordController::class, 'index'])->name('salesRecord.index');
    });
    Route::prefix('category')->group(function () {
        Route::get(null, [CategoryController::class, 'index'])->name('category.index');
    });
    Route::prefix('auctionOrder')->group(function () {
        Route::get(null, [AuctionOrderController::class, 'index'])->name('auctionOrder.index');
    });
    Route::prefix('auctionBid')->group(function () {
        Route::get(null, [AuctionBidController::class, 'index'])->name('auctionBid.index');
    });
    Route::prefix('auction')->group(function () {
        Route::get(null, [AuctionController::class, 'index'])->name('auction.index');
        Route::get('create', [AuctionController::class, 'create'])->name('auction.create');
        Route::get('{id}/edit', [AuctionController::class, 'edit'])->name('auction.edit')->whereNumber('id');
        Route::post(null, [AuctionController::class, 'store'])->name('auction.store');
        Route::put('{id}', [AuctionController::class, 'update'])->name('auction.update')->whereNumber('id');
        Route::get('{id}', [AuctionController::class, 'detail'])->name('auction.detail')->whereNumber('id');
    });
    Route::prefix('coupon')->group(function () {
        Route::get(null, [CouponController::class, 'index'])->name('coupon.index');
        Route::get('create', [CouponController::class, 'create'])->name('coupon.create');
        Route::get('{id}/edit', [CouponController::class, 'edit'])->name('coupon.edit')->whereNumber('id');
        Route::post(null, [CouponController::class, 'store'])->name('coupon.store');
        Route::put('{id}', [CouponController::class, 'update'])->name('coupon.update')->whereNumber('id');
        Route::get('{id}', [CouponController::class, 'detail'])->name('coupon.detail')->whereNumber('id');
    });
    Route::get('auth/roles', [RoleController::class, 'index'])->name('roles.index');
    Route::prefix('audit')->group(function () {
        Route::get('inviteCertification', [AuditInviteCertificationController::class, 'index'])->name('audit.inviteCertification');
        Route::get('auctionCertification', [AuditAuctionCertificationController::class, 'index'])->name('audit.auctionCertification');
        Route::get('bank', [AuditBankController::class, 'index'])->name('audit.bank');
        Route::get('realNameAuth', [AuditRealNameAuthController::class, 'index'])->name('audit.realNameAuth');
        Route::get('feedback', [AuditFeedbackController::class, 'index'])->name('audit.feedback');
        Route::get('auction', [AuditAuctionController::class, 'index'])->name('audit.auction');
        Route::get('afterSale', [AuditAfterSaleController::class, 'index'])->name('audit.afterSale');
        Route::get('withdraw', [AuditWithdrawController::class, 'index'])->name('audit.withdraw');
    });
    Route::prefix('sourceMaterial')->group(function () {
        Route::get('paging', [SourceMaterialController::class, 'paging'])->name('sourceMaterial.paging');
        Route::get('detail/{serialNumber}', [SourceMaterialController::class, 'detail'])->name('sourceMaterial.detail');
    });
    Route::prefix('shopProductSpec')->group(function () {
        Route::get(null, [ShopProductSpecController::class, 'index'])->name('shopProductSpec.index');
    });
    Route::prefix('operateLog')->group(function () {
        Route::get(null, [OperateLogController::class, 'index'])->name('operateLog.index');
    });
    Route::prefix('buyWill')->group(function () {
        Route::get(null, [BuyWillController::class, 'index'])->name('buyWill.index');
        Route::get('{id}/edit', [BuyWillController::class, 'edit'])->name('buyWill.edit')->whereNumber('id');
        Route::put('{id}', [BuyWillController::class, 'update'])->name('buyWill.update')->whereNumber('id');
        Route::get('create', [BuyWillController::class, 'create'])->name('buyWill.create');
        Route::post(null, [BuyWillController::class, 'store'])->name('buyWill.store');
    });
    Route::prefix('kefu')->group(function () {
        Route::get(null, [KefuController::class, 'index'])->name('kefu.index');
        Route::get('create', [KefuController::class, 'create'])->name('kefu.create');
        Route::get('{id}/edit', [KefuController::class, 'edit'])->name('kefu.edit')->whereNumber('id');
        Route::post(null, [KefuController::class, 'store'])->name('kefu.store');
        Route::put('{id}', [KefuController::class, 'update'])->name('kefu.update')->whereNumber('id');
    });
    Route::prefix('area')->group(function () {
        Route::get(null, [AreaController::class, 'index'])->name('area.index');
        Route::put('{id}', [AreaController::class, 'update'])->name('area.update')->whereNumber('id');
    });
    Route::prefix('address')->group(function () {
        Route::get(null, [AddressController::class, 'index'])->name('address.index');
    });
    Route::prefix('importPlug')->group(function () {
        Route::get(null, [ImportPlugController::class, 'index'])->name('importPlug.index');
        Route::get('create', [ImportPlugController::class, 'create'])->name('importPlug.create');
        Route::post(null, [ImportPlugController::class, 'store'])->name('importPlug.store');
    });

    Route::prefix('plug')->group(function () {
        Route::get(null, [PlugController::class, 'index'])->name('plug.index');
        Route::get('create', [PlugController::class, 'create'])->name('plug.create');
        Route::get('{id}/edit', [PlugController::class, 'edit'])->name('plug.edit')->whereNumber('id');
        Route::post(null, [PlugController::class, 'store'])->name('plug.store');
        Route::put('{id}', [PlugController::class, 'update'])->name('plug.update')->whereNumber('id');
        Route::get('{id}', [PlugController::class, 'detail'])->name('plug.detail')->whereNumber('id');
    });
    Route::prefix('shopProductHelp')->group(function () {
        Route::get(null, [ShopProductHelpController::class, 'index'])->name('shopProductHelp.index');
        Route::get('create', [ShopProductHelpController::class, 'create'])->name('shopProductHelp.create');
        Route::post(null, [ShopProductHelpController::class, 'store'])->name('shopProductHelp.store');
        Route::get('{id}', [ShopProductHelpController::class, 'detail'])->name('shopProductHelp.detail')->whereNumber('id');
        Route::get('{id}/edit', [ShopProductHelpController::class, 'edit'])->name('shopProductHelp.edit')->whereNumber('id');
        Route::put('{id}', [ShopProductHelpController::class, 'update'])->name('shopProductHelp.update')->whereNumber('id');
    });
});
